<!doctype html>
<html class="no-js">
<head>
  <?php include ROOT.DS.TPL_PATH.DS."meta.tpl.php";?>
  <meta name="description" content="<?=WEB_NAME?>，专注后端开发,记录平凡中的精髓，汇聚未来中的能量。">
  <meta name="keywords" content="<?=WEB_NAME?>,java开发,php开发,c#开发,后端开发">
  <title><?=WEB_NAME?>博客,技术经验,专注后端开发</title>
  <link rel="stylesheet" href="<?=TPL_PATH?>/css/blog_index.css?<?=VERSION?>">
</head>
<body class="appBackground">
<?php include ROOT.DS.TPL_PATH.DS."header.tpl.php";?>


<div class="am-g">
	<div class="am-u-md-8" id="artList">
		<div class="am-margin-top am-padding" style="background:#fff;">
			<?php if(!empty($title)){ ?>
			<div>
				<h3><em>搜索&nbsp;<span class="am-text-primary"><?=$title?></span>&nbsp;的文章</em></h3>
				<hr style="margin-bottom:0;"/>
			</div>
			<?php } else if(!empty($labelName)){ ?>
			<div>
				<h3><em>标记&nbsp;<span class="am-text-primary"><?=$labelName?></span>&nbsp;的文章</em></h3>
				<hr style="margin-bottom:0;"/>
			</div>
			<?php } else if(!empty($autor)){ ?>
			<div>
				<h3><em><span class="am-text-primary"><?=$autor?></span>&nbsp;发布的文章</em></h3>
				<hr style="margin-bottom:0;"/>
			</div>
			<?php } else {?>
			<!--选项卡 开始-->
			<div style="position:relative;">
				<div class="am-btn-group" style="z-index:1;">
					<a tabType="new" href="<?=CONTEXT_PATH?>/blog/index?sort=new" type="button" class="am-btn am-btn-default"><span class="am-icon-clock-o"></span>&nbsp;&nbsp;<b>最新</b></a>
					<a tabType="hot" href="<?=CONTEXT_PATH?>/blog/index?sort=hot" type="button" class="am-btn am-btn-default"><span class="am-icon-angellist"></span>&nbsp;&nbsp;<b>热门</b></a>
					<a tabType="rec" href="<?=CONTEXT_PATH?>/blog/index?sort=rec" type="button" class="am-btn am-btn-default"><span class="am-icon-thumbs-o-up"></span>&nbsp;&nbsp;<b>推荐</b></a>
				</div>
				<div class="app_tab_bottomLine "></div>
			</div>
			<!--选项卡 结束-->
			<?php } ?>
						
			<!--文章列表 开始-->
			<table class="am-table">
				<?php foreach($list as $i=>$r){?>
				<tr>
					<td class="format" style="width:4.2rem">
						<div>
							<span class="am-badge am-badge-secondary am-radius label"><em><?=$r->rec_nums?></em><br/>推荐</span>
							<br/>
							<span class="am-badge am-badge-default am-radius label2"><em><?=$r->hit_nums?></em><br/>浏览</span>
						</div>
					</td>
					<td class="format">
						<div class="appItem">
							<?php if(empty($r->out_link)){?>
							<a class="am-text-md appH3" target="_blank" href="<?=CONTEXT_PATH?>/blog/detail?id=<?=$r->id?>"><?=$r->title?></a>
							<?php } else { ?>
							<a class="am-text-md appH3" target="_blank" href="<?=$r->out_link?>"><?=$r->title?></a>
							<?php } ?>
							<div class="am-text-sm">
								<?=$r->summary?>
							</div>
							
							<div class="am-text-sm" style="margin-top:0.5rem;">
								<?php if($r->label_json!='[]'){?>
								<i class="am-icon-tags"></i>
								<textarea name="label" style="display:none;"><?=$r->label_json?></textarea>	
								&nbsp;&nbsp;&nbsp;&nbsp;
								<?php }?>
								<a href="<?=CONTEXT_PATH?>/blog/index?autor=<?=$r->autor?>"><em class="am-text-xs am-text-secondary"><b><?=$r->autor?></b></em></a>
								<em class="am-text-default am-text-xs"><?=format_time(strtotime($r->create_time))?></em>
							</div>
						</div>
					</td>
				</tr>
				<?php } ?>
			</table>
			<!--文章列表 结束-->
			<ul page-name="page" page-start="<?=$page?>" page-total="<?=$pages?>"
				page-param="{'label':'<?=$labelName?>','autor':'<?=$autor?>','key':'<?=$title?>','sort':'<?=$sort?>'}" 
				page-url="<?=CONTEXT_PATH?>/blog/index" 
				class="am-pagination am-pagination-centered"></ul>
		</div>
	</div>		
	<div class="am-u-md-4" style="padding-left:0;padding-right:0;">
		<div class="am-margin-top" style="margin-left:0;">
			<!--更新快播 开始-->
			<div data-am-widget="list_news" style="background:#fff;margin-top:0;padding-top:0;"  class="am-list-news am-list-news-default shadow am-padding" >
					<div class="am-list-news-hd am-cf">
					  <h2><i class="am-icon-rss-square"></i>&nbsp;更新快播</h2>
					</div>
				<div app-data-url="<?=CONTEXT_PATH?>/blog/total" class="am-list-news-bd"></div>
			</div>
			<!--更新快播 结束-->
			
			<!--分类标签 开始-->
			<div class="am-margin-top">
				<div data-am-widget="list_news" style="background:#fff;padding-top:0;"  class="am-list-news am-list-news-default shadow  am-padding" >
						<div class="am-list-news-hd am-cf">
						  <h2><i class="am-icon-bookmark-o"></i>&nbsp;分类标签</h2>
						</div>
					<div app-data-url="<?=CONTEXT_PATH?>/blog/labels" class="am-list-news-bd"></div>
				</div>
			</div>
			<!--分类标签 结束-->
		</div>	
	</div>
</div>

<?php include ROOT.DS.TPL_PATH.DS."footer.tpl.php";?>
<script src="<?=TPL_PATH?>/js/blog_index.js?<?=VERSION?>"></script>
</body>
</html>